<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-3.3.1.min.js"></script>
    <script>
        function sendAjax() {
            $.ajax({
                url:'https://gitee.com/api/v5/users/tangyang8942',
                dataType:'json',
                success:function(res){
                    console.log(res)
                    $('#name').text(res.name)
                    $('#bio').text(res.bio)
                    $('#avatar').attr('src',res.avatar_url)
                }
            })
        }

        // 回调函数
        function handle(data) {
            console.log(data)
        }

        function sendJsonp() {
            $.ajax({
                type:'get',
                url:'http://127.0.0.1:8080/ajax/jsonp',
                dataType:'jsonp', // 发送jsonp
                success:function(data){
                    console.log(data)
                }
            })
        }

        function queryIDCard() {
            // $.ajax({
            //     type:'get',
            //     url:'http://apis.juhe.cn/idcard/index',
            //     data:{
            //         key:'d5e49318a7ad71d28942b2018ada5b18',
            //         cardno:$('#idCard').val()
            //     },
            //     dataType:'jsonp',
            //     success:function(data){
            //         console.log(data)
            //     }
            // })

            var date = new Date()
            date.setDate(3)
            $.ajax({
                type:'get',
                url:'http://v.juhe.cn/joke/content/list.php',
                data:{
                    key:'ada14fdde8facce2182e047a3d434f0d',
                    pagesize:20,
                    time:1683184593,
                    sort:'desc'
                },
                dataType:'jsonp',
                success:function(data){
                    console.log(data)
                }
            })
        }
    </script>
</head>
<body>
    <button onclick="sendAjax()">发送跨域请求</button>
    <button onclick="sendJsonp()">使用jQuery发送Jsonp请求</button>
    <button onclick="sendMogu()">使用Jsonp获取蘑菇街数据</button>
    <hr>

    姓名：<span id="name"></span> <br>
    简介：<span id="bio"></span> <br>
    头像：<img src=""  id="avatar"><br>

    <img src="https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png" alt="">
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<!--    <script src="http://127.0.0.1:8080/ajax/jsonp?callback=handle"></script>-->
    <hr>

    身份证：<input type="text" id="idCard">
    <button onclick="queryIDCard()">查询身份证</button>
</body>
</html>